package com.felight.map;
/**
 * Map which accepts key and value is created.
 */

import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.LinkedHashMap;
import java.util.Set;
import java.util.TreeMap;

public class MapDemo {
	public static void main(String[] args) {
		HashMap<Integer, String> map = new HashMap<Integer, String>(); 
		//TreeMap<Integer, String> map = new TreeMap<Integer, String>();
		map.put(12, "soumya");
		map.put(31, "abc");
		map.put(23, "bob");
		map.put(23, "bobs");
		Collection<String> value = map.values(); //values() method returns the Collection which contains all values		
		for (String st : value) {
			System.out.println("Value is:" + st);
		}
		Set<Integer>key= map.keySet(); //keyset() method returns the Set which contains all keys
		
		for(Integer i:key)
		{
			System.out.println("key is:"+i);
		}
		
	}
}
